import bannersApi from '../../api/banners.api';

const state={
  data:[]
};

const getters={
  banners: (state: any) => {
    return state.data;
  }
};

const actions={
  async getBanners({commit}:any,params: any={}){
    const data=await bannersApi.getBanners(params);
    commit('setData', data);
  }
};

const mutations={
  setData(state: any, data: any){
    state.data = data;
  }
};

export default {
  namespaced: true,
  state,
  getters,
  actions,
  mutations
}